<?php
/**
 * @package scuttle
 * @file /admin/actions/WatchedEditAction.class.php
 **/

if (!defined('XOOPS_ROOT_PATH')) exit();
require_once XOOPS_MODULE_PATH. '/scuttle/class/AbstractEditAction.class.php';
require_once XOOPS_MODULE_PATH. '/scuttle/admin/forms/WatchedAdminEditForm.class.php';
require_once XOOPS_MODULE_PATH. '/scuttle/admin/include/functions.php';


class Scuttle_WatchedEditAction extends Scuttle_AbstractEditAction
{
	var $mObject = null;

	var $breadCrumbs     = array();
	var $confirmMssage   = null;
	var $moduleHeader    = null;
	var $menuDescription = null;

	function _getId()
	{
		return xoops_getrequest('wId');
	}

	function &_getHandler()
	{
		$handler =& xoops_getmodulehandler('watched');
		return $handler;
	}

	function _setupActionForm()
	{
		$this->mActionForm =& new Scuttle_WatchedAdminEditForm();
		$this->mActionForm->prepare();
	}

	function execute(&$controller, &$xoopsUser)
	{
		$ret = parent::execute($controller, $xoopsUser);
		if ($ret == SC_FRAME_VIEW_SUCCESS) {
		}

		return $ret;
	}


	function executeViewInput(&$controller, &$xoopsUser, &$render)
	{
		global $adminmenu;
		$this->breadCrumbs[]   = array('name' => _AD_SC_WATCHED ,'url'  => 'index.php?action=WatchedList' ) ;
		$this->breadCrumbs[]   = array('name' => _AD_SC_WATCHED_EDIT) ;
		$this->menuDescription = _AD_SC_WATCHED_EDIT_DSC ;

		$render->setTemplateName('scuttle_watched_edit.html');

		$render->setAttribute('module_info'   , getModuleInfo());
		$render->setAttribute('module_header' , $this->moduleHeader);
		$render->setAttribute('bread_crumbs'  , $this->breadCrumbs);
		$render->setAttribute('set_menu'      , $adminmenu );
		$render->setAttribute('set_menu_no'   , 4);
		$render->setAttribute('set_menu_desc' , $this->menuDescription);
		$render->setAttribute('confirm_mssage', $this->confirmMssage);

		$render->setAttribute('actionForm'    , $this->mActionForm);
		$render->setAttribute('object'        , $this->mObject);
	}

	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
	{
		$url = 'index.php?action=WatchedList';
		$controller->executeRedirect($url, 1, _AD_SC_WATCHED_EDIT_SUCCESS);
	}

	function executeViewError(&$controller, &$xoopsUser, &$render)
	{
		$url = 'index.php?action=WatchedList';
		$controller->executeRedirect($url, 1, _AD_SC_WATCHED_EDIT_ERROR);
	}

	function executeViewCancel(&$controller, &$xoopsUser, &$render)
	{
		$url = 'index.php?action=WatchedList';
		$controller->executeForward($url);
	}
}

?>